From: Florian Müllner Date: Wed, 11 Aug 2021 20:53:54 +0000 (+0200) Subject: appsMenu: Add side parameter X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~574^2^2~109 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=958fb6fddccc60143a1fc8a69487353a3333e592;p=gnome-shell.git appsMenu: Add side parameter In order to re-use the menu in the overview, we must be able to change the side of the arrow, so expose the parent class parameter. Part-of: --- diff --git a/js/ui/appMenu.js b/js/ui/appMenu.js index a795e8e61..85c193bfe 100644 --- a/js/ui/appMenu.js +++ b/js/ui/appMenu.js @@ -1,6 +1,6 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- /* exported AppMenu */ -const { Gio, GLib, Meta, Shell, St } = imports.gi; +const { Clutter, Gio, GLib, Meta, Shell, St } = imports.gi; const PopupMenu = imports.ui.popupMenu; const Main = imports.ui.main; @@ -8,9 +8,17 @@ const Main = imports.ui.main; var AppMenu = class AppMenu extends PopupMenu.PopupMenu { /** * @param {Clutter.Actor} sourceActor - actor the menu is attached to + * @param {St.Side} side - arrow side */ - constructor(sourceActor) { - super(sourceActor, 0.5, St.Side.TOP); + constructor(sourceActor, side = St.Side.TOP) { + if (Clutter.get_default_text_direction() === Clutter.TextDirection.RTL) { + if (side === St.Side.LEFT) + side = St.Side.RIGHT; + else if (side === St.Side.RIGHT) + side = St.Side.LEFT; + } + + super(sourceActor, 0.5, side); this.actor.add_style_class_name('app-menu');